//
//  Cover.m
//  超级团购
//
//  Created by HZ on 14-8-31.
//  Copyright (c) 2014年 cn.df. All rights reserved.
//

#import "Cover.h"

@implementation Cover


- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 1.背景色
        self.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5];
        
        // 2.自动伸缩
        self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
        
    }
    return self;
}



+ (id)cover
{
    return [[self alloc] init];
}

+ (id)coverWithTarget:(id)target action:(SEL)action
{
    Cover *cover = [self cover];
    
    [cover addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:target action:action]];
    
    return cover;
}


+ (id)coverWithView:(UIView *)view {
    Cover *cover = [self cover];
    [cover addSubview:view];
    return cover;

}
@end
